package com.seafood.dto;

import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * 订单详情DTO
 */
@Data
public class OrderItemDTO {
    
    private Long id;
    
    private Long orderId;
    
    @NotNull(message = "产品ID不能为空")
    private Long productId;
    
    @Size(max = 200, message = "产品名称长度不能超过200字符")
    private String productName;
    
    private String productImage;
    
    @NotNull(message = "数量不能为空")
    @Positive(message = "数量必须大于0")
    private Integer quantity;
    
    @NotNull(message = "单价不能为空")
    @DecimalMin(value = "0.0", message = "单价不能小于0")
    private BigDecimal unitPrice;
    
    @NotNull(message = "小计不能为空")
    @DecimalMin(value = "0.0", message = "小计不能小于0")
    private BigDecimal totalPrice;
    
    private String batchNumber;
    
    private String specifications;
    
    private String createdAt;
}